// 需要加上as const
const routes = {
  home: '/',
  admin: '/admin',
  users: '/users'
} as const

const goToRouter = (r: '/' | '/admin' | '/users') => {}
// 类型“string”的参数不能赋给类型“"/" | "/admin" | "/users"”的参数。ts(2345)
goToRouter(routes.admin)
